package org.jcb.testannotation ;


import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic.Kind;



@SupportedAnnotationTypes(value = {"TestAnnotations"})
@SupportedSourceVersion(SourceVersion.RELEASE_5)
public class AAPProcessor extends AbstractProcessor {

    @Override
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) 
    {

    	for (TypeElement element : annotations){
            System.out.println(element.getQualifiedName());
        }
        return true;
    }

    private void processElement(ExecutableElement element) 
    {
        String elementTypeStr = element.getReturnType().toString();
        if (!"java.lang.String".equals(elementTypeStr)) 
        {
            processingEnv.getMessager().printMessage(
                Kind.ERROR, 
                "Method does not return a String", 
                element);
        }
    }
}